package com.topone.dataObject.Mapper;

import com.topone.dataObject.Bussiness;
import com.topone.dto.BussinessDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by Administrator on 2018/1/18,0018.
 */
public interface BussinessMapper {


    List<BussinessDTO> allBussiness(@Param("status") Integer status);


    List<BussinessDTO> list(@Param("status") Integer status);

    List<Bussiness> bussinessCodeList(@Param("bussinessCode") String bussinessCode, @Param("status") Integer status);

    @Select("select * from bussiness where bussiness_password=#{bussinessPassword} and bussiness_phone=#{bussinessPhone}")
    @Results({
            @Result(column = "bussiness_id",property = "bussinessId")
    })
    BussinessDTO findBussinessId(@Param("bussinessPassword") String bussinessPassword, @Param("bussinessPhone") String bussinessPhone);

    //根据商家名称模糊查询
   List<BussinessDTO> findBussinessByBussinessNameLike(String bussinessName);

   BussinessDTO findBussinessItemById(String bussinessId);

   List<BussinessDTO> businessNameList(@Param("bussiness") Bussiness bussiness);

   List<BussinessDTO> businessCodeList(@Param("bussiness") Bussiness bussiness);

}
